<?php

declare (strict_types=1);
/**
 * @copyright 深圳市易果网络科技有限公司
 * @version 1.0.0
 * @link https://dayiguo.com
 */

namespace App\Request\User\UserAddr;

use App\Request\RequestAbstract;

/**
 * class
 *
 * @author 谢声强(861167322@qq.com)
 * @package App\Request\User\UserAddr
 */
class EditRequest extends RequestAbstract
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'id' => ['required', 'integer'],
            'name' => ['required', 'string', 'between:1,50'],
            'phone' => ['required', 'regex:/^1[3456789]\d{9}$/'],
            'province' => ['required', 'string', 'between:1,20'],
            'city' => ['required', 'string', 'between:1,20'],
            'district' => ['required', 'string', 'between:1,20'],
            'area_id' => ['required'],
            'address' => ['required', 'string', 'between:1,255'],
            'remark' => ['string', 'between:0,255'],
        ];
    }
}